<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<!--<link rel="stylesheet" href="../../../css/config.css">-->
<style>
	.all{
		height: 40px;
		line-height: 40px;
		border-bottom: 1px solid #ccc;
		border-top: 1px solid #ccc;
		text-indent: 1em;
	}

	.model{
		border-bottom: 1px solid #ccc;
		box-sizing: border-box;
	}

	.expirationDate{
		display: none;
	}
	.title-name {
		padding: 10px 20px ;
		background: #d7d7d7;
	}
	.submit-search{
		padding: 5px 30px !important;
	}
	#signupForm {
		padding: 0 20px;
	}

	.form-box {
		display: flex;
		padding: 15px 20px;
	}
	.form-box>div{
		width: 20%;
	}
	.control-label {
		width: 8% !important;
		text-align: left !important;
	}
	.checkbox-inline {
		padding-top: 15px !important;
	}
	.sublevel-check{
		flex: 1;
		margin-left: 10px
	}
	.first-check{
		display: flex;
	}

	.checkbox-inline {
		margin-bottom: 10px !important;
	}
	.title-Checkbox {
		width: 120px;
		margin-left: 13px;
		padding-right: 13px;
		border-right:1px solid #ccc;
		display: flex;
		align-items: center;
	}
	.title-Checkbox > span {
		margin-right: 10px;
		overflow: hidden; /* 确保超出容器的文本被裁剪 */
		white-space: nowrap; /* 确保文本在一行内显示 */
		text-overflow: ellipsis; /* 使用省略号表示文本超出 */
	}

	.all-menu {
		margin:0 !important;
	}
</style>
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight" style="padding: 0">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox-content" style="padding: 0">
				<form class="form-horizontal m-t" id="signupForm" >
					<div class="title-name">
						基本信息
					</div>
					<input id="id" th:value="${secretKey}" type="hidden">
					<input id="secretKeyId" name="id" th:value="${secretKey.id}" type="hidden">
					<div class="form-box layui-form">
						<label class="control-label">使用人：</label>
						<div class="layui-input-inline">
							<select id="userId"  name="userId" lay-search="" lay-filter="select-filter">
							</select>
						</div>
					</div>
					<div class="form-box">
						<label class=" control-label">单位名称：</label>
						<div>
							<input type="text" th:value="${secretKey.unitName}" class="form-control" id="unitName" name="unitName" placeholder="请输入单位名称">
						</div>
					</div>

<!--					<div class="form-box">-->
<!--						<label class=" control-label">密钥有效期：</label>-->
<!--						<div >-->
<!--							<select id="period"  name="type" class="form-control">-->
<!--								<option value="">请选择</option>-->
<!--								<option value="0">永久</option>-->
<!--								<option value="1">时间限定</option>-->
<!--							</select>-->
<!--						</div>-->
<!--					</div>-->

<!--					<div class="form-box expirationDate" style="display: none">-->
<!--						<label class="control-label">截止有效期：</label>-->
<!--						<div>-->
<!--							<input type="text" th:value="${secretKey.expirationDate}" class="form-control" id="expirationDate" name="expirationDate" placeholder="选择截至日期">-->
<!--						</div>-->
<!--					</div>-->

					<div class="form-box">
						<label class=" control-label">备注：</label>
						<div >
							<input type="text" th:value="${secretKey.remark}" class="form-control" id="remark" name="remark" placeholder="请输入备注">
						</div>
					</div>
					<div class="title-name" style="display: none">
						资源权限
					</div>
					<div class="form-box" style="display: none">
						<div style="width: 100%;">
							<div class="all"><span>全部</span> <input type="checkbox"></div>
							<div class="form-group children-checkbox">
								<div class="col-sm-12">
									<div th:each="courses : ${secretKey.eventrMap}" class="first-check model">
										<p  class="title-Checkbox">
											<span th:text="${courses.key}" th:title="${courses.key}"></span>
											<input class="all-menu" type="checkbox" th:checked="${courses.value.?[isShow == 1]?.size()==courses.value?.size()}">
										</p>
										<div class="sublevel-check">
											<label  class="checkbox-inline" th:each="resource : ${courses.value}">
												<input  th:text="${resource.eventName}" class="formValue" type="checkbox" th:data="${courses.key}" th:value="${resource.id}" th:checked="${resource.isShow}">
											</label>
										</div>
									</div>
								</div>
							</div>
						</div>
						<input type="hidden" id="ids">

					</div>
					<div class="form-group">
						<div style="text-align: center">
							<button type="button" class="btn btn-primary submit-search" onclick="update()">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript" src="/js/webJs/jzweb/keyManagement/edit.js?r=2">
</script>
</body>
</html>
